//
//  XBWebView.h
//  CallShow
//
//  Created by 胡锦涛 on 2018/4/23.
//  Copyright © 2018年 胡锦涛. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@protocol XBJSObjectDelegate <NSObject>
@optional
-(void)close;
-(void)login;
-(void)refresh;
-(void)getUserInfo;
-(NSString *)getHeadParams;
-(void)checkLoginState;
-(void)getResourceInfo;//测试方法
-(void)openUrlByClient:(NSString *)url;
-(void)shareByClient:(NSString *)shareInfo;
-(void)loginFlag:(NSString *)isReload;
-(void)moreLink:(NSString *)link;
-(void)showMessage:(NSString *)message;
@end

@interface WeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
@property (nonatomic, weak) id<WKScriptMessageHandler> scriptDelegate;
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate;
@end

@interface XBWebView : WKWebView
@property (nonatomic, weak) id<WKScriptMessageHandler,WKNavigationDelegate, WKUIDelegate> delegate;

- (instancetype)initWithFrame:(CGRect)frame delegate:(id<WKScriptMessageHandler,WKNavigationDelegate, WKUIDelegate>)delegate;
+ (NSString *)cookiesForWebAdding;
- (void)addCookie;
- (void)removeCookie;

@end
@interface  XBProgresspool : WKProcessPool
+(instancetype)sharedInstance;
@end

extern NSString *const JSObjectName;
